package com.jcl.recruit.crawler.dao;

import com.jcl.core.db.DatabaseContext;
import com.jcl.recruit.crawler.mapper.CrawlerDownloadResumeFeedbackMapper;
import com.jcl.recruit.crawler.model.CrawlerDownloadResumeFeedback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

@Component
public class CrawlerDownloadResumeFeedbackDao implements CrawlerDownloadResumeFeedbackMapper {

    @Autowired
    CrawlerDownloadResumeFeedbackMapper crawlerDownloadResumeFeedbackMapper;

    @Override
    public List<CrawlerDownloadResumeFeedback> findListByResumeId(String corpCode,
                                                                  Integer resumeId) {
        DatabaseContext.setCurrentContext();
        return crawlerDownloadResumeFeedbackMapper.findListByResumeId(corpCode, resumeId);
    }

    @Override
    public List<CrawlerDownloadResumeFeedback> findListByCrawlerId(String corpCode,
                                                                   Integer crawlerId) {
        DatabaseContext.setCurrentContext();
        return crawlerDownloadResumeFeedbackMapper.findListByCrawlerId(corpCode, crawlerId);
    }

    @Override
    public int add(CrawlerDownloadResumeFeedback crawlerDownloadResumeFeedback) {
        DatabaseContext.setCurrentContext();
        return crawlerDownloadResumeFeedbackMapper.add(crawlerDownloadResumeFeedback);
    }

}
